using System;
using System.Collections.Generic;
using System.Text;
using QLBH.HeThongXuLy;
using System.Data;

namespace QLBH.HeThongLuuTru
{
    class NguoiDungDAO
    {
        public static bool KiemTraNguoiDung(NguoiDungDTO user)
        {
            string sql = "select * from NGUOIDUNG where TenNguoiDung = '" + user.TenNguoiDung + "' and MatKhauNguoiDung = '" + user.MatKhau + "'";
            DataTable dt = DaTaAccess.ExecQuery(sql);
            if (dt.Rows.Count != 0)
            {
                return true; // co ton tai
            }
            else
            {
                return false;//ko ton tai
            }
        }

        public static DataTable LayDanhSachNguoiDung()
        {
            string sql = "Select * from NGUOIDUNG";
            return DaTaAccess.ExecQuery(sql);
        }

   

    }
}
